package com.rosense.server.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.rosense.server.config.HostConfigMgr;

/**
 * 
 * @author 李岩飞
 * @email eliyanfei@126.com	
 * 2017年12月11日 下午1:43:25
 *
 */
@Controller
@RequestMapping("/page")
public class PageController extends BaseController {

	@RequestMapping(value = "/history", method = RequestMethod.GET)
	public String history() {
		return "page/history";
	}
	@RequestMapping(value = "/used", method = RequestMethod.GET)
	public String used() {
		return "page/used";
	}

	@RequestMapping(value = "/detail", method = RequestMethod.GET)
	public String detail() {
		return "page/detail";
	}

	@RequestMapping(value = "/hosts", method = RequestMethod.GET)
	public String host() {
		return "page/hosts";
	}

	@RequestMapping(value = "/main", method = RequestMethod.GET)
	public String main() {
		return "main";
	}

	@RequestMapping(value = "/synData", method = RequestMethod.GET)
	public String master() {
		return "page/synData";
	}

	@RequestMapping(value = "/toSynData", method = RequestMethod.GET)
	@ResponseBody
	public String toSynData() {
		HostConfigMgr.getConfig().syncClient();
		return "true";
	}

	@RequestMapping(value = "/toSynStop", method = RequestMethod.GET)
	@ResponseBody
	public String toSynStop() {
		HostConfigMgr.getConfig().syncStop();
		return "true";
	}

}
